/*    */ package nc.pub.bcsi.ic;
/*    */ 
/*    */ import nc.bs.bcsi.plugin.BcsiPlugInPoint;
/*    */ import nc.bs.framework.common.NCLocator;
import nc.bs.uap.lock.PKLock;
/*    */ import nc.impl.pubapp.pattern.rule.processer.AroundProcesser;
/*    */ import nc.pubitf.to.m5x.ic.m4y.ITransOrderRefQuery;
/*    */ import nc.ui.querytemplate.querytree.QueryScheme;
/*    */ import nc.vo.ic.general.define.ICBillBodyVO;
import nc.vo.ic.m4y.entity.TransOutBodyVO;
import nc.vo.ic.m4y.entity.TransOutHeadVO;
/*    */ import nc.vo.ic.m4y.entity.TransOutLocationVO;
/*    */ import nc.vo.ic.m4y.entity.TransOutVO;
/*    */ import nc.vo.pub.BusinessException;
/*    */ import nc.vo.pub.SuperVO;
/*    */ import nc.vo.pubapp.pattern.exception.ExceptionUtils;
/*    */ import nc.vo.pubapp.pattern.model.entity.bill.AbstractBill;
/*    */ import nc.vo.scmpub.res.billtype.ICBillType;
/*    */ import nc.vo.to.m5x.entity.BillVO;
/*    */ 
/*    */ public class Bc5XTo4YBillActionCom extends BcSrcToICBillActionCom<TransOutVO>
/*    */ {
/*    */   public Bc5XTo4YBillActionCom()
/*    */   {
/* 22 */     super(ICBillType.TransOut.getCode(), TransOutVO.class, TransOutLocationVO.class);
/*    */     
/* 24 */     setSrcBillType("5X");
/* 25 */     setSrcBillVOClass(BillVO.class);
/*    */   }
/*    */   
/*    */   public TransOutVO[] doAction(TransOutVO[] icbills)
/*    */   {
/* 30 */     AroundProcesser<AbstractBill> prc = new AroundProcesser(BcsiPlugInPoint.RECIVE_4Y);
/*    */     
/* 32 */     prc.before(icbills);
			 for(TransOutVO vo : icbills){
				 TransOutBodyVO[] bodys = (TransOutBodyVO[]) vo.getChildrenVO();
				 for(TransOutBodyVO bvo : bodys){
					 TransOutLocationVO[] locs = (TransOutLocationVO[]) bvo.getLocationVOs();
					 for(TransOutLocationVO lvo : locs){
						 String vsn = lvo.getVserialcode();
						 if(null != vsn && !"".equals(vsn)){
							 PKLock.getInstance().addDynamicLock(vsn);
						 }
					 }
				 }
			 }

/* 33 */     TransOutVO[] bills = (TransOutVO[])doAction(icbills, "PUSHSAVE");
/* 34 */     prc.after(bills);
/* 35 */     return bills;
/*    */   }
/*    */   
/*    */   protected void calcShoulNum(ICBillBodyVO body, SuperVO srcVo)
/*    */   {
/* 40 */     super.calcShoulNum(body, srcVo);
/* 41 */     calcShoulNum(body, srcVo, "nnum", "noutnum");
/*    */   }
/*    */   
/*    */   protected AbstractBill[] queryBillInfo(QueryScheme qs)
/*    */   {
/* 46 */     AbstractBill[] rets = null;
/* 47 */     ITransOrderRefQuery service = (ITransOrderRefQuery)NCLocator.getInstance().lookup(ITransOrderRefQuery.class);
/*    */     try
/*    */     {
/* 50 */       rets = service.queryTransOrderFor4YRef(qs);
/*    */     }
/*    */     catch (BusinessException e) {
/* 53 */       ExceptionUtils.wrappException(e);
/*    */     }
/* 55 */     return rets;
/*    */   }
/*    */ }

/* Location:           E:\lifan\code\home\modules\bc\lib\pubbc_bcsi.jar
 * Qualified Name:     nc.pub.bcsi.ic.Bc5XTo4YBillActionCom
 * Java Class Version: 7 (51.0)
 * JD-Core Version:    0.7.1
 */